<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('dropdown'))
{
	function dropdown($name, $values, $selected, $disable = FALSE)
	{
		if($disable)
			$opt = "disabled = \"disabled\"";
		else
			$opt = "";
		$d = "<select name=\"$name\" $opt id=\"$name\"  >\n";
		
			if(function_exists('set_select'))
			{
				foreach($values as $value)
				{
					if ($value == $selected)
						$d .= "\t<option value=\"" . $value . "\"". set_select($name, $value, TRUE) .">" . $value . "</option>\n";
					else
						$d .= "\t<option value=\"" . $value . "\"". set_select($name, $value) .">" . $value . "</option>\n";
				}
			}
			else
			{
				foreach($values as $value)
				{
					if ($value == $selected)
						$d .= "\t<option value=\"" . $value . "\" selected=\"selected\">" . $value . "</option>\n";
					else
						$d .= "\t<option value=\"" . $value . "\">" . $value . "</option>\n";
				}
			}
				
		$d .= "</select>";
		return $d;
	}
}

if ( ! function_exists('dropdown_nationalities'))
{
	function dropdown_nationalities($name, $selected, $disable = FALSE)
	{
		$list_nationalities =  array(
			'American','Australian','Austrian','British','Canadian','Chinese','Dutch','Irish','Italian','Polish','Scottish','Spanish',
			'Afghan','Albanian','Algerian','Andorran','Angolan','Antiguans','Argentinean','Armenian','Azerbaijani','Bahamian','Bahraini','Bangladeshi',
			'Barbadian','Barbudans','Batswana','Belarusian','Belgian','Belizean','Beninese','Bhutanese','Bolivian',
			'Bosnian','Brazilian','Bruneian','Bulgarian','Burkinabe','Burmese','Burundian','Cambodian','Cameroonian','Cape Verdean',
			'Central African','Chadian','Chilean','Colombian','Comoran','Congolese','Costa Rican','Croatian','Cuban','Cypriot','Czech',
			'Danish','Djibouti','Dominican','Dominican','Dutchman','Dutchwoman','East Timorese','Ecuadorean','Egyptian','Emirian','Equatorial Guinean',
			'Eritrean','Estonian','Ethiopian','Fijian','Filipino','Finnish','French','Gabonese','Gambian','Georgian','German','Ghanaian','Greek',
			'Grenadian','Guatemalan','Guinea-Bissauan','Guinean','Guyanese','Haitian','Herzegovinian','Honduran','Hungarian','I-Kiribati','Icelander',
			'Indian','Indonesian','Iranian','Iraqi','Israeli','Ivorian','Jamaican','Japanese','Jordanian','Kazakhstani','Kenyan',
			'Kittian and Nevisian','Kuwaiti','Kyrgyz','Laotian','Latvian','Lebanese','Liberian','Libyan','Liechtensteiner','Lithuanian','Luxembourger',
			'Macedonian','Malagasy','Malawian','Malaysian','Maldivan','Malian','Maltese','Marshallese','Mauritanian','Mauritian','Mexican','Micronesian',
			'Moldovan','Monacan','Mongolian','Moroccan','Mosotho','Motswana','Mozambican','Namibian','Nauruan','Nepalese','Netherlander','New Zealander',
			'Ni-Vanuatu','Nicaraguan','Nigerian','Nigerien','North Korean','Northern Irish','Norwegian','Omani','Pakistani','Palauan','Panamanian',
			'Papua New Guinean','Paraguayan','Peruvian','Portuguese','Qatari','Romanian','Russian','Rwandan','Saint Lucian','Salvadoran',
			'Samoan','San Marinese','Sao Tomean','Saudi','Senegalese','Serbian','Seychellois','Sierra Leonean','Singaporean','Slovakian',
			'Slovenian','Solomon Islander','Somali','South African','South Korean','Sri Lankan','Sudanese','Surinamer','Swazi','Swedish',
			'Swiss','Syrian','Taiwanese','Tajik','Tanzanian','Thai','Togolese','Tongan','Trinidadian or Tobagonian','Tunisian','Turkish','Tuvaluan',
			'Ugandan','Ukrainian','Uruguayan','Uzbekistani','Venezuelan','Vietnamese','Welsh','Yemenite','Zambian','Zimbabwean'
		);
		return dropdown($name, $list_nationalities, $selected, $disable);
	}
}	

if ( ! function_exists('dropdown_countries'))
{
	function dropdown_countries($name, $selected, $disable = FALSE)
	{
			$list_countries = array ('Australia','Austria','Canada','China','France','Poland','United Kingdom','United States',
				'Afghanistan','Albania','Algeria','American Samoa','Andorra','Angola','Anguilla','Antarctica','Antigua and Barbuda',
				'Argentina','Armenia','Aruba','Azerbaijan','Bahamas','Bahrain','Bangladesh','Barbados','Belarus',
				'Belgium','Belize','Benin','Bermuda','Bhutan','Bolivia','Bosnia and Herzegovina','Botswana','Bouvet Island','Brazil',
				'British Indian Ocean Territory','Brunei Darussalam','Bulgaria','Burkina Faso','Burundi','Cambodia','Cameroon',
				'Cape Verde','Cayman Islands','Central African Republic','Chad','Chile','Christmas Island','Cocos Islands','Colombia',
				'Comoros','Congo','Cook Islands','Costa Rica','Cote d\'Ivoire','Croatia','Cuba','Cyprus',
				'Czech Republic','Denmark','Djibouti','Dominica','Dominican Republic','Ecuador','Egypt','El Salvador','Equatorial Guinea',
				'Eritrea','Estonia','Ethiopia','Falkland Islands','Faroe Islands','Fiji','Finland','French Guiana','French Polynesia',
				'Gabon','Gambia','Georgia','Germany','Ghana','Gibraltar','Greece','Greenland','Grenada','Guadeloupe','Guam','Guatemala','Guinea',
				'Guinea-Bissau','Guyana','Haiti','Honduras','Hong Kong','Hungary','Iceland','India','Indonesia',
				'Iran','Iraq','Ireland','Israel','Italy','Jamaica','Japan','Jordan','Kazakhstan','Kenya','Kiribati','Kuwait','Kyrgyzstan','Laos','Latvia',
				'Lebanon','Lesotho','Liberia','Libya','Liechtenstein','Lithuania','Luxembourg','Macao','Madagascar','Malawi','Malaysia','Maldives',
				'Mali', 'Malta','Marshall Islands','Martinique','Mauritania','Mauritius','Mayotte','Mexico','Micronesia','Moldova','Monaco','Mongolia',
				'Montenegro', 'Montserrat','Morocco','Mozambique','Myanmar','Namibia','Nauru','Nepal','Netherlands','Netherlands Antilles','New Caledonia',
				'New Zealand', 'Nicaragua','Niger','Nigeria','Norfolk Island','North Korea','Norway','Oman','Pakistan','Palau','Palestinian Territory',
				'Panama','Papua New Guinea','Paraguay','Peru','Philippines','Pitcairn','Portugal','Puerto Rico','Qatar','Romania',
				'Russian Federation','Rwanda','Saint Helena','Saint Kitts and Nevis','Saint Lucia','Saint Pierre and Miquelon','Saint Vincent and the Grenadines',
				'Samoa','San Marino','Sao Tome and Principe','Saudi Arabia','Senegal','Serbia','Seychelles','Sierra Leone','Singapore','Slovakia','Slovenia',
				'Solomon Islands','Somalia','South Africa','South Georgia','South Korea','Spain','Sri Lanka','Sudan','Suriname','Svalbard and Jan Mayen',
				'Swaziland','Sweden','Switzerland','Syrian Arab Republic','Taiwan','Tajikistan','Tanzania','Thailand','Timor-Leste','Togo','Tokelau','Tonga','Trinidad and Tobago','Tunisia','Turkey','Turkmenistan','Tuvalu','Uganda','Ukraine','United Arab Emirates',
				'Uruguay','Uzbekistan','Vanuatu','Vatican City','Venezuela',
				'Vietnam','Virgin Islands, British','Virgin Islands, U.S.','Wallis and Futuna','Western Sahara','Yemen','Zambia','Zimbabwe'
			);
		return dropdown($name, $list_countries, $selected, $disable);
	}
}	


if ( ! function_exists('dropdown_payment_method'))
{
	function dropdown_payment_method($name, $selected)
	{
			$list_method = array ('Cash','Cheque','Credit Card');
			return dropdown($name, $list_method, $selected);
	}
}	


if ( ! function_exists('dropdown_payment_location'))
{
	function dropdown_payment_location($name, $selected)
	{
			$list_location = array ('PROTX','Fort William Backpackers','nverness Student Hotel','Skye Backpackers');
			return dropdown($name, $list_location, $selected);
	}
}

?>